import React from "react";
import lazyLoad from "@/routers/utils/lazyLoad";
import { LayoutIndex } from "@/routers/constant";
import { RouteObject } from "@/routers/interface";

// 常用组件模块
const adminRouter: Array<RouteObject> = [
	{
		element: <LayoutIndex />,
		path: "/admin",
		permissions: [
			"financialRecordsView",
			"adminView",
			"adminRolesView",
		],
		meta: {
			title: "系统管理",
			icon: "UserOutlined",
			sort: 1,
		},
		children: [
			{
				path: "/admin/adminUser",
				element: lazyLoad(React.lazy(() => import("@/views/admin/adminUser/index"))),
				meta: {
					requiresAuth: true,
					icon: "UserOutlined",
					title: "用户管理",
					key: "adminView",
				}
			},
			{
				path: "/admin/adminRoles",
				element: lazyLoad(React.lazy(() => import("@/views/admin/adminRoles/index"))),
				meta: {
					requiresAuth: true,
					icon: "UserOutlined",
					title: "角色管理",
					key: "adminRolesView",
				}
			},
			{
				path: "/admin/financialRecords",
				element: lazyLoad(React.lazy(() => import("@/views/admin/adminFinancial/index"))),
				meta: {
					requiresAuth: true,
					icon: "UserOutlined",
					title: "财务中心",
					key: "financialRecordsView",
				}
			},
			{
				path: "/admin/financialRecords",
				element: lazyLoad(React.lazy(() => import("@/views/admin/guide/index"))),
				meta: {
					requiresAuth: true,
					icon: "UserOutlined",
					title: "用户管理",
					key: "adminView1",
				}
			},
			{
				path: "/admin/svgIcon",
				element: lazyLoad(React.lazy(() => import("@/views/admin/svgIcon/index"))),
				meta: {
					requiresAuth: true,
					icon: "UserOutlined",
					title: "角色管理",
					key: "adminRolesView2",
				}
			},
			{
				path: "/admin/batchImport",
				element: lazyLoad(React.lazy(() => import("@/views/admin/batchImport/index"))),
				meta: {
					requiresAuth: true,
					icon: "UserOutlined",
					title: "财务中心1",
					key: "financialRecordsView1",
				}
			}
		],
	}
];

export default adminRouter;
